package org.example.platform.design.zerenlian.shizhan;

import com.alibaba.fastjson.JSON;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 责任链模式
 */
public class Test {
    private static SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 时间格式化

    public static void main(String[] args) throws ParseException {
        ShenPo shenPo = new SanJi().ShenPo(new ErJi());
        SanJi sanJi = new SanJi();
        ErJi erJi = new ErJi();
        YiJi yiJi = new YiJi();
        sanJi.ShenPo(erJi);
        erJi.ShenPo(yiJi);

        AuthInfo authInfo = new AuthInfo("0001", "单号：", "1000998004813441", " 状态：待二级审批负责人 ", "张经理");
        authInfo.setDate(f.parse("2020-06-12 00:00:00"));
        AuthInfo authInfo3 =  sanJi.getResult(authInfo);
        System.out.println(authInfo3.toString());

        AuthInfo authInfo2 = new AuthInfo("0001", "单号：", "1000998004813441", " 状态：待三级审批负责人 ", "王工");
        authInfo2.setDate(f.parse("2020-06-13 00:00:00"));
        AuthInfo authInfo4 =   sanJi.getResult(authInfo2);
        System.out.println(authInfo4.toString());
    }
}
